package com.example.heathy_me.reportDetail.utils;


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.example.heathy_me.R;

public class ReportContentActivity extends AppCompatActivity {

    public static void actionStart(Context context, String reportTitle, String reportContent) {
        Intent intent = new Intent(context, ReportContentActivity.class);
        intent.putExtra("report_title", reportTitle);
        intent.putExtra("report_content", reportContent);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.report_content);
        String reportTitle = getIntent().getStringExtra("report_title"); // 获取传入的标题
        String reportContent = getIntent().getStringExtra("report_content"); // 获取传入的内容
        ReportContentFragment reportContentFragment = (ReportContentFragment) getSupportFragmentManager().findFragmentById(R.id.report_content_fragment);
        reportContentFragment.refresh(reportTitle, reportContent); // 刷新reportContentFragment界面
    }

}
